import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import { getToken } from '@/utils/auth'

const routes = [
  {
    path: '/',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/index.vue'),
    children: [
      {
        path: 'homePage',
        name: 'homePage',
        component: () => import('@/views/homePage/index.vue'),
        meta: { title: '首页' }
      },
      {
        path: 'lottie',
        name: 'lottie',
        component: () => import('@/views/lottie/index.vue'),
        meta: { title: 'lottie' }
      },
      {
        path: 'readExcelHeader',
        name: 'readExcelHeader',
        component: () => import('@/views/readExcelHeader/index.vue'),
        meta: { title: '读取表头和公式', icon: 'tree' }
      }
    ]
  }
]
const router = createRouter({
  history: createWebHashHistory(),
  routes: routes
})
// 全局导航守卫

export default router
